/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "adm_sistema")
@NamedQueries({
    @NamedQuery(name = "AdmSistema.findAll", query = "SELECT a FROM AdmSistema a")})
public class AdmSistema implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_sistema")
    private Short idSistema;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 256)
    @Column(name = "nombre")
    private String nombre;
    @Size(max = 512)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "clave")
    private String clave;
    @Size(max = 256)
    @Column(name = "url")
    private String url;
    @Size(max = 256)
    @Column(name = "context_path")
    private String contextPath;
    @Size(max = 256)
    @Column(name = "host")
    private String host;
    @Size(max = 4)
    @Column(name = "anio")
    private String anio;
    @JoinTable(name = "adm_sistema_menu", joinColumns = {
        @JoinColumn(name = "id_sistema", referencedColumnName = "id_sistema")}, inverseJoinColumns = {
        @JoinColumn(name = "id_menu", referencedColumnName = "id_menu")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<AdmMenu> admMenuList;
    @OneToMany(mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmMenu> admMenuList1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmDatosGlobales> admDatosGlobalesList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmSesion> admSesionList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmAuditoria> admAuditoriaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmAccion> admAccionList;
    @OneToMany(mappedBy = "admSistema", fetch = FetchType.LAZY)
    private List<AdmRol> admRolList;

    public AdmSistema() {
    }

    public AdmSistema(Short idSistema) {
        this.idSistema = idSistema;
    }

    public AdmSistema(Short idSistema, String nombre, String clave) {
        this.idSistema = idSistema;
        this.nombre = nombre;
        this.clave = clave;
    }

    public Short getIdSistema() {
        return idSistema;
    }

    public void setIdSistema(Short idSistema) {
        this.idSistema = idSistema;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getClave() {
        return clave;
    }

    public void setClave(String clave) {
        this.clave = clave;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getAnio() {
        return anio;
    }

    public void setAnio(String anio) {
        this.anio = anio;
    }

    public List<AdmMenu> getAdmMenuList() {
        return admMenuList;
    }

    public void setAdmMenuList(List<AdmMenu> admMenuList) {
        this.admMenuList = admMenuList;
    }

    public List<AdmMenu> getAdmMenuList1() {
        return admMenuList1;
    }

    public void setAdmMenuList1(List<AdmMenu> admMenuList1) {
        this.admMenuList1 = admMenuList1;
    }

    public List<AdmDatosGlobales> getAdmDatosGlobalesList() {
        return admDatosGlobalesList;
    }

    public void setAdmDatosGlobalesList(List<AdmDatosGlobales> admDatosGlobalesList) {
        this.admDatosGlobalesList = admDatosGlobalesList;
    }

    public List<AdmSesion> getAdmSesionList() {
        return admSesionList;
    }

    public void setAdmSesionList(List<AdmSesion> admSesionList) {
        this.admSesionList = admSesionList;
    }

    public List<AdmAuditoria> getAdmAuditoriaList() {
        return admAuditoriaList;
    }

    public void setAdmAuditoriaList(List<AdmAuditoria> admAuditoriaList) {
        this.admAuditoriaList = admAuditoriaList;
    }

    public List<AdmAccion> getAdmAccionList() {
        return admAccionList;
    }

    public void setAdmAccionList(List<AdmAccion> admAccionList) {
        this.admAccionList = admAccionList;
    }

    public List<AdmRol> getAdmRolList() {
        return admRolList;
    }

    public void setAdmRolList(List<AdmRol> admRolList) {
        this.admRolList = admRolList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSistema != null ? idSistema.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdmSistema)) {
            return false;
        }
        AdmSistema other = (AdmSistema) object;
        if ((this.idSistema == null && other.idSistema != null) || (this.idSistema != null && !this.idSistema.equals(other.idSistema))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.AdmSistema[ idSistema=" + idSistema + " ]";
    }

}
